Skip to content

refactor: extract shared hash_content into execute/hash.rs#282

Merged
branchseer merged 2 commits intovoidzero-dev:mainfrom
yangshun:refactor/deduplicate-hash-content
Mar 22, 2026
Merged

refactor: extract shared hash_content into execute/hash.rs#282
branchseer merged 2 commits intovoidzero-dev:mainfrom
yangshun:refactor/deduplicate-hash-content

Conversation

@yangshun
Copy link
Collaborator

@yangshun yangshun commented Mar 21, 2026

Summary

Extract the 8 KiB buffered xxHash3_64 hashing logic from fingerprint.rs and glob_inputs.rs into a shared execute/hash.rs module.

Note

I used Claude to find this duplication, reasoned with it back-and-forth to see if it was really an improvement, concluded that it was just a small one.

Both call sites were identical, but strictly speaking the logic doesn't need to be shared. If not desired, just close the PR.

Test plan

  • cargo test -p vite_task — all 27 tests pass

Both `fingerprint.rs` and `glob_inputs.rs` implemented identical 8 KiB
buffered xxHash3_64 hashing for cache invalidation. Extract into a
shared `hash.rs` module to ensure consistent hashes across code paths —
if either diverges, cache lookups would silently break.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yangshun yangshun force-pushed the refactor/deduplicate-hash-content branch from d753a7f to f92824f Compare March 21, 2026 02:33
@yangshun yangshun requested a review from branchseer March 21, 2026 02:44
Copy link
Member

branchseer commented Mar 22, 2026

Merge activity

  • Mar 22, 1:29 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 22, 1:30 AM UTC: Graphite couldn't merge this PR because it failed for an unknown reason (Fast-forward merges are not supported for forked repositories. Please create a branch in the target repository in order to merge).
  • Mar 22, 1:58 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 22, 1:58 AM UTC: Graphite couldn't merge this PR because it failed for an unknown reason (Fast-forward merges are not supported for forked repositories. Please create a branch in the target repository in order to merge).

@branchseer
Copy link
Member

Thanks. It does need to be shared!

@branchseer branchseer merged commit 2a8ee32 into voidzero-dev:main Mar 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants